package h0726;

import java.util.Arrays;
import java.util.Scanner;

public class WeiQi {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] black = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        int[] white = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();

        int[][] board = new int[19][19]; //定义棋盘
        for (int i = 0; i < black.length; i += 2) {
            int x = black[i];
            int y = black[i + 1];
            board[x][y] = 1;   //设置黑棋为1
        }
        for (int i = 0; i < white.length; i += 2) {
            int x = white[i];
            int y = white[i + 1];
            board[x][y] = 2;   //设置白棋为2
        }

        //定义偏移量
        int[][] offsets={
                {0,-1}, //左
                {0,1},  //右
                {-1,0},  //上
                {1,0}  //下
        };

        int blackCount=0;
        int whiteCount=0;
        for (int i = 0; i < 19; i++) {
            for (int j = 0; j < 19; j++) {
                if (board[i][j]==0){
                    boolean isBlackQi=false;
                    boolean isWhiteQi=false;
                    for (int k = 0; k < offsets.length; k++) {

                        int x = i + offsets[k][0];
                        int y = j + offsets[k][1];
                        if (x<0||x>=19||y<0||y>=19) continue; //边缘位置忽略

                        if (board[x][y]==1){
                            isBlackQi=true;
                        }
                        if (board[x][y]==2){
                            isWhiteQi=true;
                        }
                    }
                    if (isBlackQi){
                        blackCount++;
                    }
                    if (isWhiteQi){
                        whiteCount++;
                    }
                }
            }
        }
        System.out.println(blackCount+" "+whiteCount);
    }
}
